package angels.client.Entities;
import org.json.JSONException;
import org.json.JSONObject;
import com.google.android.maps.GeoPoint;

public class Business {
	private String name;
	private String desc;
	private GeoPoint coords;
	private String imageURL;
	private float rating;
	private String bkey;
	private String category;
	private String subCategory;
	
	public Business(JSONObject json_robots) throws JSONException {	
		//TODO: Add this and tell Ilan to add this in server
		//rating = Float.parseFloat(json_robots.getString("rat"));
		//desc = json_robots.getString("desc");
		name = json_robots.getString("name");
		imageURL=json_robots.getString("pic");
		bkey=json_robots.getString("bkey");
		category=json_robots.getString("cat");
		subCategory=json_robots.getString("sub");
		String[] xy =json_robots.getString("loc").split(",");
	    coords = new GeoPoint(
	            (int) (Double.parseDouble(xy[0]) * 1E6),
	            (int) (Double.parseDouble(xy[1]) * 1E6)
	    );
	}
	
	public String getName(){
		return name;
	}
	
	public String getDescription(){
		return desc;
	}
	
	public GeoPoint getCoords(){
		return coords;
	}
	
	public String getImageURL(){
		return imageURL; 
	}
	
	public float getRating(){
		return rating;
	}
	
	public String getCategory(){
		return category; 
	}
	
	public String getSubCategory(){
		return subCategory; 
	}
	
	public String getBisKey(){
		return bkey; 
	}
}